#include <stdio.h>


//这个struct没初始化
struct Book1{

	int id;
	char *name;
	float price;
};

//初始化struct
struct Book2{

	int id;
	char name[10];
	float price;
} book2={
	
	200,
	"xiaoshuo2",
	36.62
};


struct Book3{

	int id;
        char *name;
        float price;
} book3;

int main(void)
{
	struct Book1 book1; //如果struct没有初始化，则需要这样声明对象
	book1.id=10001;
	book1.name="xiaoshuo1";
	book1.price=22.6;

	printf("%d\n",book1.id);
	printf("%s\n",book1.name);
	printf("%.2f\n",book1.price);


	printf("%d\n",book2.id);
        printf("%s\n",book2.name);
        printf("%.2f\n",book2.price);


	book3.id=1222;
        book3.name="xiaoshuo3";
        book3.price=116.6;

	printf("%d\n",book3.id);
        printf("%s\n",book3.name);
        printf("%.2f\n",book3.price);



	return 0;

}
